<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main"><i class="glyphicon glyphicon-cog"></i> 系统管理</a></li>
        <li><a ui-sref="main.sys.clientm.list" class="active" ng-bind="title">会话管理</a></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg dataWarn"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>
<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-heading clearfix">
                <div class="w-auto">
                    <form ng-submit="search()" class="form-inline">
                        <div class="form-group">
                            <label for="app_code">应用编码：</label>
                            <input type="text"class="form-control" style="width: 180px"id="app_code"placeholder="" ng-model="param.app_code">
                        </div>
                        <div class="form-group">
                            <label for="app_name">应用名称：</label>
                            <input type="text"class="form-control" style="width: 180px"id="app_name"placeholder="" ng-model="param.app_name">
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary new-primary"style="margin-left: 10px" ng-show="read">查询</button>
                        </div>
                        <div class="form-group">
                            <a ui-sref="main.sys.clientm.create" class="btn btn-primary addNew" ng-show="add"><i
                                    class="glyphicon glyphicon-plus"></i>新增</a>
                        </div>
                    </form>
                </div>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th>应用编码</th>
                        <th>应用名称</th>
                        <th>应用英文名</th>
                        <th>应用状态</th>
                        <th>应用版本</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.data">
                        <td class="v-middle">{{item.app_code}}</td>
                        <td class="v-middle">{{item.app_name}}</td>
                        <td class="v-middle">{{item.app_en_name}}</td>
                        <td class="v-middle">
                            <span ng-if="item.app_status==-1" class="text-danger">停用</span>
                            <span ng-if="item.app_status==1000" class="text-success">商用</span>
                            <span ng-if="item.app_status==1001" class="text-danger">待发布</span>
                        </td>
                        <td class="v-middle">{{item.app_version}}</td>
                        <td class="v-middle">
                            <p class="handle-p">
                                <a href="#" ng-if="item.app_status==-1"ui-sref="main.sys.clientm.update({'id':item.app_id})" ng-show="update">变更</a>
                                <a href="#" ng-if="item.app_status==1001"ui-sref="main.sys.clientm.update({'id':item.app_id})" ng-show="update">变更</a>
                                <a href="#" ng-if="item.app_status==1001" ng-click="updateAppStatus(item.app_id,1000)"ng-show="update">发布</a>
                                <a href="#" ng-if="item.app_status==1000" ng-click="updateAppStatus(item.app_id,-1)"ng-show="update">禁用</a>
                                <a href="#" ng-if="item.app_status==-1" ng-click="updateAppStatus(item.app_id,1001)"ng-show="update">启用</a>
                                <a ng-if="item.app_status!=1000" ng-click="delAppInfo(item.app_id)"ng-show="dele">删除</a>
                            </p>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div>
    </div>

</div>

<style type="text/css" scoped>
    .table-responsive table thead th {
        width: auto !important;
        padding: 15px 0;
        margin: 0;
    }

    .table-responsive table tbody tr td {
        margin: 0;
        padding: 9px 0;
        width: auto;
    }

    .handle-p {
        margin: 0;
        padding: 0;
        width: 180px;
        font-size: 16px;
    }

    .handle-p a {
        padding: 2px 5px;
    }
</style>